/*
package NiuKe;

import java.util.Scanner;

*/
/**
 * @Description:
 * @Author: Hanzao
 * @Date: 2022/06/19/13:15
 *//*

public class HJ84 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        int tmp = 0 ;
        for(int i=0;i<s.length();i++){
            if(s.charAt(i)>='A'&&s.charAt(i)<='Z'){
                tmp++;
            }
        }
        System.out.println(tmp);
    }
}
*/
